/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.notaria.guerrasalas.be;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author Administrador
 */
@Entity
@Table(name = "OTRO_ACTO_JURIDICO", catalog = "BASE_NOTARIAL", schema = "dbo")
@NamedQueries({@NamedQuery(name = "OtroActoJuridico.findAll", query = "SELECT o FROM OtroActoJuridico o"), @NamedQuery(name = "OtroActoJuridico.findByIdOtroActoJuridico", query = "SELECT o FROM OtroActoJuridico o WHERE o.idOtroActoJuridico = :idOtroActoJuridico")})
public class OtroActoJuridico implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_OTRO_ACTO_JURIDICO", nullable = false)
    private Long idOtroActoJuridico;
    @Basic(optional = false)
    @Lob
    @Column(name = "DETALLE", nullable = false, length = 1073741823)
    private String detalle;
    @JoinColumn(name = "ID_OTRO_ACTO_JURIDICO", referencedColumnName = "ID_ACTO_JURIDICO", nullable = false, insertable = false, updatable = false)
    @OneToOne(optional = false, fetch = FetchType.LAZY)
    private ActoJuridicoConParticipantes actoJuridicoConParticipantes;

    public OtroActoJuridico() {
    }

    public OtroActoJuridico(Long idOtroActoJuridico) {
        this.idOtroActoJuridico = idOtroActoJuridico;
    }

    public OtroActoJuridico(Long idOtroActoJuridico, String detalle) {
        this.idOtroActoJuridico = idOtroActoJuridico;
        this.detalle = detalle;
    }

    public Long getIdOtroActoJuridico() {
        return idOtroActoJuridico;
    }

    public void setIdOtroActoJuridico(Long idOtroActoJuridico) {
        this.idOtroActoJuridico = idOtroActoJuridico;
    }

    public String getDetalle() {
        return detalle;
    }

    public void setDetalle(String detalle) {
        this.detalle = detalle;
    }

    public ActoJuridicoConParticipantes getActoJuridicoConParticipantes() {
        return actoJuridicoConParticipantes;
    }

    public void setActoJuridicoConParticipantes(ActoJuridicoConParticipantes actoJuridicoConParticipantes) {
        this.actoJuridicoConParticipantes = actoJuridicoConParticipantes;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idOtroActoJuridico != null ? idOtroActoJuridico.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof OtroActoJuridico)) {
            return false;
        }
        OtroActoJuridico other = (OtroActoJuridico) object;
        if ((this.idOtroActoJuridico == null && other.idOtroActoJuridico != null) || (this.idOtroActoJuridico != null && !this.idOtroActoJuridico.equals(other.idOtroActoJuridico))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.notaria.guerrasalas.be.OtroActoJuridico[idOtroActoJuridico=" + idOtroActoJuridico + "]";
    }

}
